1. Field of the Invention
The present invention relates to an interface driver program for a computer for controlling interactions among device drivers of the computer. More specifically, the present invention relates to the interface driver program for a computer which is an interface among device drivers operating in a kernel mode, and an interface among device drivers and application programs.
2. Description of the Related Art
A computer comprises many hardware resources, such a central processing unit (CPU), storage devices (memory, hard disk, etc.), input devices (keyboard, mouse, etc.), output devices (display, etc.), and card slots for connecting to peripheral devices (printer, scanner, etc.). This hardware is controlled by and operates according to an OS (operating system) stored in the storage device.
Various application programs, operating on a computer, run on the OS. The OS controls all operations of the computer, internalizes the differences in different hardware specifications, and provides a common environment for application programs. In effect, the OS is the software for providing basic functions shared by many application programs, such as input/output functions for keyboard input and screen output, and disk and memory management, and for controlling the entire system of the computer. The OS is sometimes called “basic software”.
Computer hardware is manufactured by a plurality of makers and has different specifications depending on the maker. It is desirable to develop application programs such that the user is not conscious of differences in these hardware specifications. The OS internalizes these differences in the hardware specifications and provides a common environment for application programs.
The developers of application programs can put less work into development by using the functions provided by the OS and standardize the operational properties of application programs. Application programs developed for a particular OS can basically be used on any computer whereon that OS is running.
MS-DOS (registered trademark), UNIX (registered trademark), Linux, FreeBSD (registered trademark), and so on are representative of the many types of OS's. The Windows series from Microsoft is the most popular OS for enterprise and general household users. The Mac OS (registered trademark) from Apple is widely used in the areas of DTP and multimedia. Various flavors of UNIX OS's and UNIX-based OS's such as Linux and FreeBSD, available at no cost, are widely used for company servers and by academic institutions. In recent years, Microsoft Windows NT/2000 (registered trademark) has been expanding its share of the server OS market.
[Conventional Architecture]
FIG. 9 shows a schematic of the Windows NT/2000 (registered trademark) architecture as a representative OS. As understood from FIG. 9, Windows NT/2000 has an overall layered structure comprising the hardware 2, OS 3, and application programs 4 for realizing the functions actually requested by users.
The kernel mode 8 is constituted of the various types of software (kernel mode software) operating on that layer, and centering around the microkernel 51. The application program 4, in the uppermost layer, operates in the user mode 9. The OS 3 generally comprises an executive 50, microkernel 51, and hardware abstraction layer (HAL) 52. The HAL 52 is a program which focuses on the control of hardware located in the layer immediately above the hardware 2. This is a program for internalizing the various and assorted hardware and specifications, such as of the processor, and for providing the same environment to upper level services (microkernel 51, executive 50, etc.).
The microkernel 51 provides the basic functions of the entire system. The executive 50 is an aggregate of programs for realize the provision of the main services of the OS 3 by using services provided by the microkernel 51 and HAL 52. The executive 50 includes representative executive programs such as a cache manager 53, object manager 54, process manager 55, memory manager 56, and I/O manager 57.
The object manager 54 is a program for monitoring, and controlling and regulating, existing objects. The process manager 55 is a program for monitoring and regulating operating processes. The cache manager 53 and memory manager 56 are programs for controlling and regulating memory and virtual memory. The I/O manager 57 is a program for monitoring and controlling the input/output functions of the OS. When the computer is operating with this executive 50, this is called the kernel mode 8.
In the kernel mode 8, all commands for operating the OS 3 can be executed and when a command is executed by mistake, it can have a negative influence on the system as a whole. Also, there is a user mode 9 which is completely open to users of application programs or the like. In this user mode 9, commands for operating the OS 3 are controlled so as not to have a negative influence on the system. Because the system automatically captures commands which would have a negative influence on the system, this becomes a very easy to use environment for the user.
The establishment of this type of control is the same as controlling the functions of the OS 3, and application programs 4 running in the user mode become unable to directly access portions relating to the hardware 2 and must go through the kernel mode 8. The kernel mode 8 can fully use the functions of the OS 3 and has complete access to each of the input/output devices. Also, programs operating in the kernel mode 8 are processed with greater priority than programs in the user mode 9 and high performance can thereby be attained.
The device drivers 5 are software associated with the OS 3 and have the purpose of controlling hardware external to the computer, and run in the kernel mode 8. Normally, there is a device affiliated with each device driver 5. Application programs 4 running in the user mode 9 must go through the device drivers 5 to access each device.
In the case of transferring data from the device A to the device B as shown in FIG. 10, for example, the flow of data becomes as follows: device A>device driver A>(switch operating mode from kernel mode 8 to user mode 9) application program 4 (switch operating mode from user mode 9 to kernel mode 8)>device driver B>device B. This system continues with processing while switching the operating mode from kernel mode 8 to user mode 9, or from user mode 9 to kernel mode 8.
The switching between the user mode 9 and kernel mode 8 is a process which takes time. When a large quantity of data, such as image data, is transferred, the transfer speed becomes slow and the transfer takes time. For this reason, it is difficult to improve the transfer speed at the application level. This is because it is necessary to switch between the user mode 9 and kernel mode 8 for each process of the application program 4.
The conventional operation procedure when transferring data among devices is explained. FIG. 10 shows a schematic of the relationship among the application program 4, device drivers 5, and operating modes 8 and 9. As understood from the drawing, the application program 4 operates in the user mode 9.
The device drivers 5 are combined with the OS 3 and operate in the kernel mode 8. The devices 6 constituting the hardware 2 of the computer comprise various types of internal devices and external devices connected with the computer, and are controlled only by their respective device drivers 5. In effect, access to the devices 6 is carried out through the device drivers 5. The device drivers 5 operate according to commands from the application program 4 through the OS 3.
The flow of the data transmission is explained next with reference to the flowchart in FIG. 11. The flow of data when an application program 4 operating in the user mode 9 transfers data from the device A to the device B is explained while comparing the operating modes 8 and 9 of the system. The application program 4 outputs a data transfer request (command) (S50).
At this time, a data sending request is output to the device A (S51) and a data reception request is output to the device B (S52). The system operating mode changes from the user mode 9 to the kernel mode 8. The device driver A receives the data sending request (S53) and sends [the request] to the device A (S54). The device A receives the data sending request (S55) and sends the data (S56). The device driver A receives the data sent (S57), performs internal processing (S58), and sends the data to the application program 4 (S59).
The system operating mode changes from the kernel mode 8 to the user mode 9; and the application program 4 receives data, performs processing (S60, S61), and sends the processing results to the device driver B (S62). The system operating mode again changes from the user mode 9 to the kernel mode 8. The device driver B receives the data (S63), performs internal processing (S64), and sends the results to the device B (S65).
The device B receives the data (S66), and sends “data received” information to the device driver B (S67). The device driver B receives the “data received” information (S68), and notifies the application program 4 that data transfer is complete (S69). The system changes to the user mode 9; and the application program 4 receives the [notification] that data transfer is complete (S70) and switches to the next process, and the series of data transfer processes comes to an end (S71).
In this way, the data are transferred as follows: device A>device driver A>(switch operating mode) application program 4 (switch operating mode)>device driver B>device B. During this time, the system operating mode is repeatedly switched between the kernel mode 8 and user mode 9 in the operation. When a large quantity of data is being handled, the operating mode is switched a large number of times.
Furthermore, when another application program is running on the system at the same time, the operating mode is switched a large number of times for the system as a whole because the system switches operating modes for that [other] application as well. This becomes a factor in the slowing of execution processing among the application programs. The increased switching of the operating mode reduces the speed of the data sending and receiving process. This cannot help but become a factor in the disruption or the like of images displayed on screen, particularly in the case where real time [processing] is a major demand, such as in image processing.
In order to ensure system performance in this type of system, the development and engineering of device drivers for controlling hardware 2 becomes important, along with the development and design of the hardware. Especially when transferring large quantities of data such as image data, it is desirable to reduce the switching between the user mode 9 and kernel mode 8 and increase the speed of data transmission. When the integrity of the data is a major requirement, it is desirable to make the transfer within the kernel mode 8 which the user cannot touch.